# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=gsound
pkgver=1.0.3
pkgrel=1
pkgdesc="Small library for playing system sounds"
url="https://wiki.gnome.org/Projects/GSound"
license=(LGPL)
arch=(x86_64)
depends=(glib2 libcanberra)
makedepends=(gobject-introspection vala git gtk-doc meson)
_commit=95d36d60cf53e0e7c5d5325e0f1f4fc765a611ae  # tags/1.0.3^0
source=("git+https://gitlab.gnome.org/GNOME/gsound.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libg{lib,object,io}-2.0.so libcanberra.so)
  provides+=(libgsound.so)

  meson install -C build --destdir "$pkgdir"
}
